package user

import "github.com/google/uuid"

type CreateConversationRequest struct {
	Prompt string `json:"prompt" validate:"required,min=1,max=10000"`
}

type CreateConversationResponse struct {
	ID        uuid.UUID `json:"id"`
	Title     string    `json:"title"`
	UserID    uuid.UUID `json:"user_id"`
	CreatedAt int64     `json:"created_at"`
	UpdatedAt int64     `json:"updated_at"`
}

type GetConversationsResponse struct {
	Rows  []ConversationRow `json:"rows"`
	Total int               `json:"total"`
}

type ConversationRow struct {
	ID        uuid.UUID `json:"id"`
	Title     string    `json:"title"`
	UserID    uuid.UUID `json:"user_id"`
	CreatedAt int64     `json:"created_at"`
	UpdatedAt int64     `json:"updated_at"`
}

type DeleteConversationRequest struct {
	ID string `param:"id" validate:"required,uuid"`
}

type GetConversationMessagesRequest struct {
	ID string `param:"conversation_id" validate:"required,uuid"`
}

type GetConversationMessagesResponse struct {
	Rows  []MessageRow `json:"rows"`
	Total int          `json:"total"`
}

type MessageRow struct {
	ID             uuid.UUID `json:"id"`
	ConversationID uuid.UUID `json:"conversation_id"`
	Role           string    `json:"role"`
	Content        string    `json:"content"`
	Status         string    `json:"status"`
	CreatedAt      int64     `json:"created_at"`
	// Assistant message metadata
	ProcessingTime int64  `json:"processing_time,omitempty"`
	Model          string `json:"model,omitempty"`
	TokensUsed     int    `json:"tokens_used,omitempty"`
	ErrorMessage   string `json:"error_message,omitempty"`
}
